package com.zhentao.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 * 污染预测记录表
 * @TableName pollution_prediction
 */
@TableName(value ="pollution_prediction")
@Data
public class PollutionPrediction implements Serializable {
    /**
     * 预测ID
     */
    @TableId(type = IdType.AUTO)
    private Long predictionId;

    /**
     * 预测类型：1-扩散预测，2-影响预测
     */
    private Integer predictionType;

    /**
     * 污染源工厂ID
     */
    private Long sourceFactoryId;

    /**
     * 目标区域
     */
    private String targetArea;

    /**
     * 预测时间
     */
    private Date predictionTime;

    /**
     * 预测结果
     */
    private String predictionResult;

    /**
     * 置信度
     */
    private BigDecimal confidenceLevel;

    /**
     * 影响半径
     */
    private BigDecimal impactRadius;

    /**
     * 状态：1-预测中，2-已完成
     */
    private Integer status;

    /**
     * 创建时间
     */
    private Date createTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        PollutionPrediction other = (PollutionPrediction) that;
        return (this.getPredictionId() == null ? other.getPredictionId() == null : this.getPredictionId().equals(other.getPredictionId()))
            && (this.getPredictionType() == null ? other.getPredictionType() == null : this.getPredictionType().equals(other.getPredictionType()))
            && (this.getSourceFactoryId() == null ? other.getSourceFactoryId() == null : this.getSourceFactoryId().equals(other.getSourceFactoryId()))
            && (this.getTargetArea() == null ? other.getTargetArea() == null : this.getTargetArea().equals(other.getTargetArea()))
            && (this.getPredictionTime() == null ? other.getPredictionTime() == null : this.getPredictionTime().equals(other.getPredictionTime()))
            && (this.getPredictionResult() == null ? other.getPredictionResult() == null : this.getPredictionResult().equals(other.getPredictionResult()))
            && (this.getConfidenceLevel() == null ? other.getConfidenceLevel() == null : this.getConfidenceLevel().equals(other.getConfidenceLevel()))
            && (this.getImpactRadius() == null ? other.getImpactRadius() == null : this.getImpactRadius().equals(other.getImpactRadius()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getPredictionId() == null) ? 0 : getPredictionId().hashCode());
        result = prime * result + ((getPredictionType() == null) ? 0 : getPredictionType().hashCode());
        result = prime * result + ((getSourceFactoryId() == null) ? 0 : getSourceFactoryId().hashCode());
        result = prime * result + ((getTargetArea() == null) ? 0 : getTargetArea().hashCode());
        result = prime * result + ((getPredictionTime() == null) ? 0 : getPredictionTime().hashCode());
        result = prime * result + ((getPredictionResult() == null) ? 0 : getPredictionResult().hashCode());
        result = prime * result + ((getConfidenceLevel() == null) ? 0 : getConfidenceLevel().hashCode());
        result = prime * result + ((getImpactRadius() == null) ? 0 : getImpactRadius().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", predictionId=").append(predictionId);
        sb.append(", predictionType=").append(predictionType);
        sb.append(", sourceFactoryId=").append(sourceFactoryId);
        sb.append(", targetArea=").append(targetArea);
        sb.append(", predictionTime=").append(predictionTime);
        sb.append(", predictionResult=").append(predictionResult);
        sb.append(", confidenceLevel=").append(confidenceLevel);
        sb.append(", impactRadius=").append(impactRadius);
        sb.append(", status=").append(status);
        sb.append(", createTime=").append(createTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}